<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%-- <%@ include file="/page/company/comHeader.jsp" %> --%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<s:if test="menu.menuId!=null">
<title>企业编辑广告</title>
</s:if>
<s:else>
<title>企业申请广告</title>
</s:else>

<link href="<%=basePath %>css/reset.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
	
*{
font-family: '微软雅黑';font-size: 15px;
}
</style>
<script type="text/javascript">
function replaceUpload(obj){
	//alert(111);
	 if(obj.checked==true){
           $("#uploadImage").show();
           
		}else{
			 $("#uploadImage").hide();
	         
			}
}




</script>
</head>
<body>
<form action="<%=basePath %>com/ads_saveAd" method="post" id="save">
<s:hidden name="ads.adId" value="%{ads.adId}" id="adId"></s:hidden>
<s:hidden name="ads.adImage" value="%{ads.adImage}" id="imageUrl"></s:hidden>
<s:hidden name="ads.created" value="%{ads.created}"></s:hidden>
<s:hidden id="picstyle" value="%{ads.styleId}"></s:hidden>
<s:hidden name="ads.comId" value="%{#session.company.comId}"></s:hidden>
<div style="width: 500px;height: 850px;background-color: #f0f8ff ;">
<table>
<tr height="40px;">
<td width="110px">广告名称<span style="color:red">*</span>：</td>
<td width="270px"><s:textfield name="ads.adName" value="%{ads.adName}" placeholder="请输入广告名称"  theme="simple" style="width:90%;height:100%"></s:textfield></td>
<td width="100px;"></td>
</tr>
<tr height="100px;">
<td width="110px">广告说明<span style="color:red">*</span>：</td>
<td width="270px"><s:textarea  rows="3" name="ads.adDesc" value="%{ads.adDesc}" placeholder="请输入广告说明"  theme="simple" style="width:90%;height:90%"></s:textarea><a href="javascript:;" class="tip ib" title='自定义填写内容，如：客户签订合同编号、发票编号等'>tips</a></td>
<td width="100px;"></td>
</tr>
<tr height="100px;">
<td width="110px">是否轮播<span style="color:red">*</span>：</td>
<td width="270px"><input type="radio" name="ads.isCarousel" value="1" checked="checked"/>轮播<input type="radio" name="ads.isCarousel" value="0"/>不轮播<a href="javascript:;" class="tip ib" title='自定义填写内容，如：客户签订合同编号、发票编号等'>tips</a></td>
<td width="100px;"></td>
</tr>
<tr height="40px;">
<td width="110px">出价<span style="color:red">*</span>：</td>
<td width="270px"><s:textfield name="ads.price" value="%{ads.price}" placeholder="请输入出价"  theme="simple" style="width:90%;height:100%"></s:textfield></td>
<td width="100px;"></td>
</tr>
<tr height="80px;">
<td width="110px">图片尺寸<span style="color:red">*</span>：</td>
<td width="270px" colspan="2" style="background-color: #f0e68c">
<s:iterator value="%{picStyles}" id="picStyle" status="pic">
<s:if test="#picStyle.styleValue=='1200*100'">
<input type="radio" class="pics" value='<s:property value="#picStyle.styleId"/>' checked="checked" name="ads.styleId"/><s:property value="#picStyle.styleValue"/><span style="color:red">(推荐)</span>&nbsp;&nbsp;
</s:if>
<s:else>
<input type="radio" class="pics" value='<s:property value="#picStyle.styleId"/>' name="ads.styleId"/><s:property value="#picStyle.styleValue"/>&nbsp;&nbsp; 
</s:else>
<s:if test="#pic.index==4"><br/></s:if>
</s:iterator>
</td>
</tr>
<s:if test="ads.adId!=null">
<tr height="100px;">
<td width="110px"></td>
<td width="70px"><input type="checkbox" id="repUpload" onclick="replaceUpload(this)"/>重新上传图片</td>
<td width="100px;" align="left"><a href="<%=basePath%>upload/<s:property value="ads.adImage"/>"  target="_bank">查看图片</a> </td>
</tr>
<%-- <tr id="upload1" height="40px;">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr>
<tr id="upload2" height="750px;" style="display: none">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr> --%>
</s:if>
<s:else>
<%-- <tr height="750px;">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr> --%>
</s:else>
</table>
</div>
</form>
<s:if test="ads.adId!=null">
<div id="uploadImage" style="position: absolute;left:120px;top:450px;display: none"><jsp:include page="/page/common/fileUpload.jsp"></jsp:include> </div>
</s:if>
<s:else>
<div style="position: absolute;left:120px;top:380px;"><jsp:include page="/page/common/fileUpload.jsp"></jsp:include> </div>
</s:else>
<%-- <jsp:include page="/page/company/comFooter.jsp"></jsp:include> --%>
</body>
<script type="text/javascript">
var picstyle=$("#picstyle").val();
if(picstyle!=null){
	$(".pics").removeAttr('checked'); 
	$(".pics[value="+picstyle+"]").attr("checked","checked");
}

</script>
</html>